package com.modifier;

import java.util.stream.StreamSupport;

/**
 * @Author 小闽
 * @Date 2024/8/6 10:50
 * @PackageName: com.modifier
 * @ClassName: A
 * @Description: 修饰符
 * @Version 1.0
 */
public class A {
    public int n1 = 10;
    protected int n2 = 20;
    int n3 = 30;
    private int n4 = 40;
    public void say(){
        System.out.println("n1= " + n1 + "n2= " + n2 + "n3= " + n3 + "n4= " + n4);
    }
    public void m1(){};
    void m2(){}
    protected void m3(){};
    private void m4(){};

    // 在同一个类中可以调用其他的方法，所有被方法访问的修饰符都可以
    public void hi(){
        m1();
        m2();
        m3();
        m4();
    }
}
